﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<KLS.PPDS.Web.Models.ArticleContentViewModel>" %>
<%@ Import Namespace="KLS.PPDS.Utilities" %>
<%@ Import Namespace="KLS.PPDS.Resources" %>
<%@ Import Namespace="KLS.PPDS.Utility.Html" %>
<div class="thumbnils">
    <%if (Model.TextFiles != null && Model.TextFiles.Count > 0)
      {

          var deleteHref = string.Format("/ArticleContent/DeleteTextFile?pubId={0}&artId={1}&conId={2}", Model.PublicationId, Model.ArticleId, Model.Id);
          var fileName = Model.TextFiles[0].FileOriginalName + " " + Model.TextFiles[0].FileSize + CommonString.Megabyte;
          var sourceOriginalText = string.Format("/ArticleContent/DownloadTextFile?pubId={0}&artId={1}&conId={2}&file={3}", Model.PublicationId, Model.ArticleId, Model.Id, Model.TextFiles[0].FileName);

          //var contentLoadHref = string.Format("/ArticleContent/DeleteTextFile?pubId={0}&artId={1}&conId={2}", Model.PublicationId, Model.ArticleId, Model.Id);
    %>
    <%if (!Model.IsTextDisable)
      {
         
    %>
    <%:Html.DivActionLink("", "", new { @class = "delete-article-text-button", @href = deleteHref, @target = "div#articleContent_" + Model.Id, @message = CommonMessage.DeleteConfirmation })%>
    <%} %>
    <a href="<%:sourceOriginalText %>" target="_blank" >
     <img src="../../Content/images/Paper thumb.png" name="" alt="Paper thumb.png" title="<%:fileName %>" />
    </a>
    <%
        } %>
    <br />
    <%  //var ediotr = Model.IsReadyForEditor.Equals(false) && Model.IsTextDisable.Equals(false) ? (object)new { @type = "CheckBox", @class = "checkbox" } : (object)new { @type = "CheckBox", @class = "checkbox", @checked = "checked" };
        var disabled = Model.IsTextDisable.Equals(true) ? "disabled" : "";
        var chkEditor = Model.IsReadyForEditor.Equals(true) ? "checked" : "";
        var chkGraphics = Model.IsReadyForGraphic.Equals(true) ? "checked" : "";
    %>
    
    
    <span>
        <%--<%:Html.CheckBoxFor(c => c.IsReadyForEditor, (object)ediotr)%>--%>
        <input name="IsReadyForEditor" class="checkbox chk-sub-editor" id="IsReadyForEditor" type="checkbox" value="true" <%:disabled%> <%:chkEditor %>/>
        <label><%:Html.Label(KLS.PPDS.Resources.CommonString.ReadyForEditing) %></label>
    </span>
    <br />
    <%  
        var graphicsChkDisable = Model.IsGraphicsChkDisable.Equals(true) ? "disabled" : "";
     %>
    <span>
        
        <input name="IsReadyForGraphic" class="checkbox chk-sub-graphic" id="IsReadyForGraphic" type="checkbox" value="true" <%:graphicsChkDisable%> <%:chkGraphics %>/>
        <label><%:Html.Label(KLS.PPDS.Resources.CommonString.ReadyForLayout) %></label>
    </span>
</div>
